package com.kgcx.coupon.domain;

import com.kgcx.common.annotation.dict.Dict;
import com.kgcx.dbutils.annotation.SelectBetweenAnd;
import com.kgcx.dbutils.domain.BaseDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Table;
import javax.persistence.Transient;
import java.sql.Timestamp;
import java.util.List;

/**
 * 发票
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Table(name = "t_billing")
@ApiModel("发票记录")
public class Billing extends BaseDomain {


    @ApiModelProperty(value = "用户id", required = true, example = "1")
    private Integer userId;

    @ApiModelProperty(value = "发票抬头,字典:invoiceCategory", required = false, example = "0")
    private String title;

    @ApiModelProperty(value = "发票抬头,字典:invoiceCategory", readOnly = true, example = "个人发票")
    @Dict(type = "invoiceCategory", fieldName = "title")
    @Transient
    private String titleValue;

    @ApiModelProperty(value = "发票单号", required = false, example = "12312312312")
    private String billingNo;

    @ApiModelProperty(value = "发票类别,字典:billingType", required = true, example = "1")
    private String billingType;

    @ApiModelProperty(value = "发票类别,字典:billingType", readOnly = true, example = "纸质发票")
    @Dict(type = "billingType", fieldName = "billingType")
    @Transient
    private String billingTypeValue;

    @ApiModelProperty(value = "发票金额", required = true, example = "1")
    private Integer money;

    @ApiModelProperty(value = "发票张数", required = true, example = "1")
    private Integer billingNumber;

    @ApiModelProperty(value = "总金额", required = true, example = "100")
    private Integer amount;

    @ApiModelProperty(value = "纳税人识别号", required = false, example = "string")
    private String idNumber;

    @ApiModelProperty(value = "下单时间", required = false, example = "1513143491")
    @SelectBetweenAnd
    private Timestamp orderTime;

    @ApiModelProperty(value = "收件人姓名", required = true, example = "string")
    private String userName;

    @ApiModelProperty(value = "收件人电话", required = true, example = "15656565656")
    private String phone;

    @ApiModelProperty(value = "收件人城市", required = true, example = "湖南")
    private String city;

    @ApiModelProperty(value = "收件详细地址", required = true, example = "湖南长沙天心区")
    private String address;

    @ApiModelProperty(value = "订单状态(待审核1 待开票2  待邮寄3  已邮寄4),字典:billingStatus", required = false, example = "1")
    private Integer orderStatus;

    @ApiModelProperty(value = "订单状态,字典:billingStatus", readOnly = true, example = "待审核")
    @Dict(type = "invoiceOrderStatus", fieldName = "orderStatus")
    @Transient
    private String orderStatusValue;

    @ApiModelProperty(value = "邮寄单号", required = false, example = "23444")
    private String mailNumber;

    @ApiModelProperty(value = "公司名称", required = false, example = "你好")
    private String company;

    @ApiModelProperty(value = "发票内容", required = true, example = "string")
    private String content;

    @ApiModelProperty(value = "注册地址", required = false, example = "长沙")
    private String registerAddress;

    @ApiModelProperty(value = "注册电话", required = false, example = "15655565656")
    private String registerPhone;

    @ApiModelProperty(value = "注册银行", required = false, example = "建设")
    private String bank;

    @ApiModelProperty(value = "银行账户", required = false, example = "13234323554223")
    private String bankNumber;


    @ApiModelProperty(value = "用户想开票金额", required = false, example = "200")
    private Integer wmoney;

    /**
     * 发票明细
     */
    @Transient
    @ApiModelProperty(value = "发票开票详情", required = true)
    private List<BillingDetail> detailList;

}
